<div class="page user-painel">
    <div class="box-header">
        <h2 class="col-xs-12 box-title">Detalhes da Conta</h2>
    </div>
    <?php
    echo form_open(BASE_URL_USER . '/updateAccount');
    echo form_hidden('USER_ID', userData()->id);
    ?>

    <div class="col-xs-3 col-md-2">
        <div class="form-group">
            <?php
            echo form_label('LOGIN');
            echo form_input('', $user->LOGIN, 'class="form-control disabled" readonly="readonly"');
            ?>
        </div>
    </div>
    <div class="col-xs-9 col-md-6"> 
        <div class="form-group">
            <?php
            echo form_label('NOME/RAZÃO SOCIAL');
            echo form_input('NOME', $user->NOME, 'class="form-control"');
            ?>      
        </div>
    </div>
    <?php if ($user->TIPO == 'J'): ?>
        <div class="col-xs-8 col-md-6">
            <div class="form-group">
                <?php
                echo form_label('NOME FANTASIA');
                echo form_input('NOME_FANTASIA', $user->NOME_FANTASIA, 'class="form-control"');
                ?>      
            </div>
        </div>
    <?php endif; ?>
    <div class="col-xs-4 col-md-2">
        <div class="form-group">
            <?php
            $mask = $user->TIPO == 'J' ? '999.999.999/9999-99' : '999.999.999-99';
            echo form_label('CPF/CNPJ');
            echo form_input('CPF_CNPJ', $user->CPF_CNPJ, 'class="form-control disabled" on-mask  match="' . $mask . '" disabled="disabled"');
            ?>
        </div>
    </div>
    <div class="col-xs-4 col-md-2">
        <div class="form-group">
            <?php
            echo form_label('RG/I.E');
            echo form_input('RG_IE', $user->RG_IE, 'class="form-control"');
            ?>
        </div>
    </div>
    <?php if ($user->TIPO != 'J'): ?>

        <div class="col-xs-4 col-md-2"> 
            <div class="form-group">
                <?php
                echo form_label('SEXO');
                echo form_dropdown('SEXO', array('F' => 'FEMINIMO', 'M' => 'MASCULINO'), $user->SEXO, 'class="form-control"');
                ?>
            </div>
        </div>
        <div class="col-xs-3 col-md-2"> 
            <div class="form-group">
                <?php
                echo form_label('ESTADO CIVIL');
                $options_estado_civil = array('CASADO' => 'CASADO(A)', 'SOLTEIRO' => 'SOLTEIRO(A)', 'VIUVO' => 'VIÚVO(A)', 'SEPARADO' => 'SEPARADO(A');
                echo form_dropdown('ESTADO_CIVIL', $options_estado_civil, $user->ESTADO_CIVIL, 'class="form-control"');
                ?>
            </div>
        </div>

        <div class="col-xs-3 col-md-2"> 
            <div class="form-group">
                <?php
                echo form_label('NASCIMENTO');
                echo form_input('NASCIMENTO', extract_data($user->NASCIMENTO, '/'), 'class="form-control" on-mask  match="99/99/9999"');
                ?>
            </div>
        </div>
        <div class="col-xs-3 col-md-2"> 
            <div class="form-group">
                <?php
                echo form_label('NACIONALIDADE');
                echo form_input('NACIONALIDADE', $user->NACIONALIDADE, 'class="form-control"');
                ?>
            </div>
        </div>  
        <div class="col-xs-3 col-md-2"> 
            <div class="form-group">
                <?php
                echo form_label('CNH');
                echo form_input('CNH', $user->CNH, 'class="form-control"');
                ?>
            </div>
        </div>  
        <div class="col-xs-6 col-md-4"> 
            <div class="form-group">
                <?php
                echo form_label('PROFISSÃO');
                echo form_input('PROFISSAO', $user->PROFISSAO, 'class="form-control"');
                ?>
            </div>
        </div>

        <div class="col-xs-6 col-md-4"> 
            <div class="form-group">
                <?php
                echo form_label('NOME DA MÃE');
                echo form_input('NOME_MAE', $user->NOME_MAE, 'class="form-control"');
                ?>
            </div>
        </div>

    <?php endif; ?>
    <div class="col-xs-6 col-md-4">
        <div class="form-group">
            <?php
            echo form_label('EMAIL');
            echo form_input('EMAIL', $user->EMAIL, 'class="form-control"');
            ?>
        </div>
    </div>
    <div class="col-xs-6 col-md-4">
        <div class="form-group">
            <?php
            echo form_label('EMAIL ALTERNATIVO');
            echo form_input('EMAIL_ALTERNATIVO', $user->EMAIL_ALTERNATIVO, 'class="form-control"');
            ?>
        </div>
    </div>
    <?php if ($user->TIPO == 'J'): ?>
        <div class="clearfix"></div>
        <div class="col-xs-3 col-md-2">
            <div class="form-group">
                <?php
                echo form_label('CONTATO');
                echo form_input('CONTATO', $user->CONTATO, 'class="form-control"');
                ?>
            </div>
        </div>
    <?php endif; ?>
    <div class="col-xs-3 col-md-2">
        <div class="form-group">
            <?php
            echo form_label('CELULAR');
            echo form_input('CELULAR', $user->CELULAR, 'class="form-control"  on-mask  match="(99)99999-9999"');
            ?>
        </div>
    </div>

    <div class="col-xs-3 col-md-2">
        <div class="form-group">
            <?php
            echo form_label('TELEFONE');
            echo form_input('TELEFONE', $user->TELEFONE, 'class="form-control" on-mask  match="(99)9999-9999"');
            ?>
        </div>
    </div>
    <div class="col-xs-3 col-md-2">
        <div class="form-group">
            <?php
            echo form_label('TELEFONE 2');
            echo form_input('TELEFONE_2', $user->TELEFONE_2, 'class="form-control" on-mask  match="(99)9999-9999"');
            ?>
        </div>
    </div>

    <div class="clearfix"></div>
    <div class="col-xs-3 col-md-1">
        <div class="form-group">
            <?php
            echo form_label('CEP');
            echo form_input('CEP', $user->CEP, 'class="form-control" on-mask  match="99999-999"');
            ?>
        </div>
    </div>
    <div class="col-xs-7 col-md-5">
        <div class="form-group">
            <?php
            echo form_label('ENDEREÇO');
            echo form_input('LOGRADOURO', $user->LOGRADOURO, 'class="form-control"');
            ?>
        </div>
    </div>
    <div class="col-xs-2 col-md-1">
        <div class="form-group">
            <?php
            echo form_label('NÚMERO');
            echo form_input('NUMERO', $user->NUMERO, 'class="form-control"');
            ?>
        </div>
    </div>
    <div class="col-xs-6 col-md-3">
        <div class="form-group">
            <?php
            echo form_label('COMPLEMENTO');
            echo form_input('COMPLEMENTO', $user->COMPLEMENTO, 'class="form-control"');
            ?>
        </div>
    </div>
    <div class="col-xs-6 col-md-3">
        <div class="form-group">
            <?php
            echo form_label('BAIRRO');
            echo form_input('BAIRRO', $user->BAIRRO, 'class="form-control"');
            ?>
        </div>
    </div>
    <div class="col-xs-6 col-md-3">
        <div class="form-group">
            <?php
            echo form_label('CIDADE');
            echo form_input('CIDADE', $user->CIDADE, 'class="form-control"');
            ?>
        </div>
    </div>
    <div class="col-xs-2 col-md-1">
        <div class="form-group">
            <?php
            echo form_label('UF');
            echo form_input('UF', $user->UF, 'class="form-control"');
            ?>
        </div>
    </div>
    <div class="clearfix"></div>
    <div class="col-xs-3 col-md-2">
        <div class="form-group">
            <?php
            echo form_label('SENHA');
            echo form_password('PWD', '', 'class="form-control"');
            ?>
        </div>
    </div>
    <div class="clearfix"></div>
    <div class="col-xs-2 col-md-1">
        <div class="form-group">
            <?php
            echo form_label('&nbsp;');
            echo form_submit('', 'SALVAR', 'class="form-control"');
            ?>
        </div>
    </div>
    <?php echo form_close(); ?>
    <div class="clearfix"></div>
</div>

<?php
add_js('plugins/frontend/jquery.mask', 'footer', 8);
add_js('plugins/frontend/jquery.autocompleteCep', 'footer', 8);
add_js('scripts/user/jquery.account', 'footer', 14);
